<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.sms.note.*, com.sms.servlet.*"%>
<%@ page import="net.sf.json.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%
request.setCharacterEncoding("UTF-8");
List<Map> jlist=new ArrayList<Map> ();
    	jlist=Note.query();
    	//System.out.println(jlist.size());
    	JSONArray json = new JSONArray(); 
    	 for(int i=0;i<jlist.size();i++){
    		 Map map=jlist.get(i);
    		Note rep=new Note();   		
    		rep.init(map);
    		 JSONObject j=new JSONObject();
    		 j.put("infoid",rep.getInfoid());
    		 j.put("name", map.get("name"));
    		 j.put("notetime", rep.getNotetime());
    		 j.put("readnum",map.get("readnum"));
    		 j.put("detail", "详情");  
    		 j.put("title", rep.getTitle());    		     		    		 
    		 j.put("isappend",((map.get("isappend").equals("1")?"有附件":"无") ));
    		 json.add(j);
    	 }
    	 System.out.println(json);
out.println(json);
 %>
